import Vue from 'vue'
import http from './intercept'

Vue.prototype.$http = {
  async getswipelist(params) {
    return http.get('/api/getlunbo', params)
  },
  async getGrid(params) {
    return http.get('/api/grids', params)
  },
  async getNewsList(params) {
    return http.get('/api/getnewslist', params)
  },
  async getNewsInfo(params) {
    return http.get('/api/getnew/' + params)
  },
  async getComments({ id, pageNo, pageSize }) {
    return http.get(`/api/getcomments/${id}?pageindex=${pageNo}&limit=${pageSize}`)
  },
  async postComment({ id, content }) {
    return http.post(`/api/postcomment/${id}`, { content })
  },
  async getiImgCategory(params) {
    return http.get('/api/getimgcategory', params)
  },
  async getImages(params) {
    return http.get('/api/getimages/' + params)
  },
  async getImageInfo(params) {
    return http.get('/api/getimageInfo/' + params)
  },
  async getThumImages(params) {
    return http.get('/api/getthumimages/' + params)
  },
  async getGoods({ pageNo, pageSize }) {
    return http.get(`/api/getgoods?pageindex=${pageNo}&limit=${pageSize}`)
  }
}
